Optimal. Leaf size=267 \[ -\frac {\left (a^2-7 b^2\right ) \left (a^2-b^2\right )^2 \cos (c+d x)}{a^8 d}-\frac {3 b \left (a^2-b^2\right )^2 \cos ^2(c+d x)}{a^7 d}+\frac {\left (3 a^4-9 a^2 b^2+5 b^4\right ) \cos ^3(c+d x)}{3 a^6 d}+\frac {b \left (3 a^2-2 b^2\right ) \cos ^4(c+d x)}{2 a^5 d}-\frac {3 \left (a^2-b^2\right ) \cos ^5(c+d x)}{5 a^4 d}-\frac {b \cos ^6(c+d x)}{3 a^3 d}+\frac {\cos ^7(c+d x)}{7 a^2 d}+\frac {b^2 \left (a^2-b^2\right )^3}{a^9 d (b+a \cos (c+d x))}+\frac {2 b \left (a^2-4 b^2\right ) \left (a^2-b^2\right )^2 \log (b+a \cos (c+d x))}{a^9 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.26, antiderivative size = 267, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.190, Rules used = {3957, 2916, 12,
962} \begin {gather*} -\frac {b \cos ^6(c+d x)}{3 a^3 d}+\frac {\cos ^7(c+d x)}{7 a^2 d}+\frac {b^2 \left (a^2-b^2\right )^3}{a^9 d (a \cos (c+d x)+b)}+\frac {2 b \left (a^2-4 b^2\right ) \left (a^2-b^2\right )^2 \log (a \cos (c+d x)+b)}{a^9 d}-\frac {\left (a^2-7 b^2\right ) \left (a^2-b^2\right )^2 \cos (c+d x)}{a^8 d}-\frac {3 b \left (a^2-b^2\right )^2 \cos ^2(c+d x)}{a^7 d}+\frac {b \left (3 a^2-2 b^2\right ) \cos ^4(c+d x)}{2 a^5 d}-\frac {3 \left (a^2-b^2\right ) \cos ^5(c+d x)}{5 a^4 d}+\frac {\left (3 a^4-9 a^2 b^2+5 b^4\right ) \cos ^3(c+d x)}{3 a^6 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 962
Rule 2916
Rule 3957
Rubi steps
\begin {align*} \int \frac {\sin ^7(c+d x)}{(a+b \sec (c+d x))^2} \, dx &=\int \frac {\cos ^2(c+d x) \sin ^7(c+d x)}{(-b-a \cos (c+d x))^2} \, dx\\ &=\frac {\text {Subst}\left (\int \frac {x^2 \left (a^2-x^2\right )^3}{a^2 (-b+x)^2} \, dx,x,-a \cos (c+d x)\right )}{a^7 d}\\ &=\frac {\text {Subst}\left (\int \frac {x^2 \left (a^2-x^2\right )^3}{(-b+x)^2} \, dx,x,-a \cos (c+d x)\right )}{a^9 d}\\ &=\frac {\text {Subst}\left (\int \left (\left (a^2-7 b^2\right ) \left (a^2-b^2\right )^2-\frac {b^2 \left (-a^2+b^2\right )^3}{(b-x)^2}+\frac {2 b \left (-a^2+b^2\right )^2 \left (-a^2+4 b^2\right )}{b-x}-6 b \left (-a^2+b^2\right )^2 x-\left (3 a^4-9 a^2 b^2+5 b^4\right ) x^2-2 b \left (-3 a^2+2 b^2\right ) x^3+3 \left (a^2-b^2\right ) x^4-2 b x^5-x^6\right ) \, dx,x,-a \cos (c+d x)\right )}{a^9 d}\\ &=-\frac {\left (a^2-7 b^2\right ) \left (a^2-b^2\right )^2 \cos (c+d x)}{a^8 d}-\frac {3 b \left (a^2-b^2\right )^2 \cos ^2(c+d x)}{a^7 d}+\frac {\left (3 a^4-9 a^2 b^2+5 b^4\right ) \cos ^3(c+d x)}{3 a^6 d}+\frac {b \left (3 a^2-2 b^2\right ) \cos ^4(c+d x)}{2 a^5 d}-\frac {3 \left (a^2-b^2\right ) \cos ^5(c+d x)}{5 a^4 d}-\frac {b \cos ^6(c+d x)}{3 a^3 d}+\frac {\cos ^7(c+d x)}{7 a^2 d}+\frac {b^2 \left (a^2-b^2\right )^3}{a^9 d (b+a \cos (c+d x))}+\frac {2 b \left (a^2-4 b^2\right ) \left (a^2-b^2\right )^2 \log (b+a \cos (c+d x))}{a^9 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 2.34, size = 417, normalized size = 1.56 \begin {gather*} \frac {-3675 a^8+61320 a^6 b^2-132720 a^4 b^4+87360 a^2 b^6-13440 b^8-140 \left (21 a^8-228 a^6 b^2+400 a^4 b^4-192 a^2 b^6\right ) \cos (2 (c+d x))-3780 a^7 b \cos (3 (c+d x))+8400 a^5 b^3 \cos (3 (c+d x))-4480 a^3 b^5 \cos (3 (c+d x))+588 a^8 \cos (4 (c+d x))-1848 a^6 b^2 \cos (4 (c+d x))+1120 a^4 b^4 \cos (4 (c+d x))+476 a^7 b \cos (5 (c+d x))-336 a^5 b^3 \cos (5 (c+d x))-132 a^8 \cos (6 (c+d x))+112 a^6 b^2 \cos (6 (c+d x))-40 a^7 b \cos (7 (c+d x))+15 a^8 \cos (8 (c+d x))+26880 a^6 b^2 \log (b+a \cos (c+d x))-161280 a^4 b^4 \log (b+a \cos (c+d x))+241920 a^2 b^6 \log (b+a \cos (c+d x))-107520 b^8 \log (b+a \cos (c+d x))+1680 a b \cos (c+d x) \left (-8 a^6+67 a^4 b^2-116 a^2 b^4+56 b^6+16 \left (a^2-4 b^2\right ) \left (a^2-b^2\right )^2 \log (b+a \cos (c+d x))\right )}{13440 a^9 d (b+a \cos (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.29, size = 321, normalized size = 1.20 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 271, normalized size = 1.01 \begin {gather*} \frac {\frac {210 \, {\left (a^{6} b^{2} - 3 \, a^{4} b^{4} + 3 \, a^{2} b^{6} - b^{8}\right )}}{a^{10} \cos \left (d x + c\right ) + a^{9} b} + \frac {30 \, a^{6} \cos \left (d x + c\right )^{7} - 70 \, a^{5} b \cos \left (d x + c\right )^{6} - 126 \, {\left (a^{6} - a^{4} b^{2}\right )} \cos \left (d x + c\right )^{5} + 105 \, {\left (3 \, a^{5} b - 2 \, a^{3} b^{3}\right )} \cos \left (d x + c\right )^{4} + 70 \, {\left (3 \, a^{6} - 9 \, a^{4} b^{2} + 5 \, a^{2} b^{4}\right )} \cos \left (d x + c\right )^{3} - 630 \, {\left (a^{5} b - 2 \, a^{3} b^{3} + a b^{5}\right )} \cos \left (d x + c\right )^{2} - 210 \, {\left (a^{6} - 9 \, a^{4} b^{2} + 15 \, a^{2} b^{4} - 7 \, b^{6}\right )} \cos \left (d x + c\right )}{a^{8}} + \frac {420 \, {\left (a^{6} b - 6 \, a^{4} b^{3} + 9 \, a^{2} b^{5} - 4 \, b^{7}\right )} \log \left (a \cos \left (d x + c\right ) + b\right )}{a^{9}}}{210 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.70, size = 344, normalized size = 1.29 \begin {gather*} \frac {120 \, a^{8} \cos \left (d x + c\right )^{8} - 160 \, a^{7} b \cos \left (d x + c\right )^{7} + 1715 \, a^{6} b^{2} - 4725 \, a^{4} b^{4} + 3780 \, a^{2} b^{6} - 840 \, b^{8} - 56 \, {\left (9 \, a^{8} - 4 \, a^{6} b^{2}\right )} \cos \left (d x + c\right )^{6} + 84 \, {\left (9 \, a^{7} b - 4 \, a^{5} b^{3}\right )} \cos \left (d x + c\right )^{5} + 140 \, {\left (6 \, a^{8} - 9 \, a^{6} b^{2} + 4 \, a^{4} b^{4}\right )} \cos \left (d x + c\right )^{4} - 280 \, {\left (6 \, a^{7} b - 9 \, a^{5} b^{3} + 4 \, a^{3} b^{5}\right )} \cos \left (d x + c\right )^{3} - 840 \, {\left (a^{8} - 6 \, a^{6} b^{2} + 9 \, a^{4} b^{4} - 4 \, a^{2} b^{6}\right )} \cos \left (d x + c\right )^{2} + 35 \, {\left (a^{7} b + 153 \, a^{5} b^{3} - 324 \, a^{3} b^{5} + 168 \, a b^{7}\right )} \cos \left (d x + c\right ) + 1680 \, {\left (a^{6} b^{2} - 6 \, a^{4} b^{4} + 9 \, a^{2} b^{6} - 4 \, b^{8} + {\left (a^{7} b - 6 \, a^{5} b^{3} + 9 \, a^{3} b^{5} - 4 \, a b^{7}\right )} \cos \left (d x + c\right )\right )} \log \left (a \cos \left (d x + c\right ) + b\right )}{840 \, {\left (a^{10} d \cos \left (d x + c\right ) + a^{9} b d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1861 vs.
\(2 (257) = 514\).
time = 0.52, size = 1861, normalized size = 6.97 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.19, size = 588, normalized size = 2.20 \begin {gather*} \frac {{\cos \left (c+d\,x\right )}^4\,\left (\frac {b^3}{2\,a^5}+\frac {b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{2\,a}\right )}{d}-\frac {{\cos \left (c+d\,x\right )}^2\,\left (\frac {b^2\,\left (\frac {2\,b^3}{a^5}+\frac {2\,b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a}\right )}{2\,a^2}+\frac {b\,\left (\frac {3}{a^2}+\frac {b^2\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a^2}-\frac {2\,b\,\left (\frac {2\,b^3}{a^5}+\frac {2\,b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a}\right )}{a}\right )}{a}\right )}{d}-\frac {{\cos \left (c+d\,x\right )}^5\,\left (\frac {3}{5\,a^2}-\frac {3\,b^2}{5\,a^4}\right )}{d}+\frac {{\cos \left (c+d\,x\right )}^7}{7\,a^2\,d}-\frac {\cos \left (c+d\,x\right )\,\left (\frac {1}{a^2}+\frac {b^2\,\left (\frac {3}{a^2}+\frac {b^2\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a^2}-\frac {2\,b\,\left (\frac {2\,b^3}{a^5}+\frac {2\,b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a}\right )}{a}\right )}{a^2}-\frac {2\,b\,\left (\frac {b^2\,\left (\frac {2\,b^3}{a^5}+\frac {2\,b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a}\right )}{a^2}+\frac {2\,b\,\left (\frac {3}{a^2}+\frac {b^2\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a^2}-\frac {2\,b\,\left (\frac {2\,b^3}{a^5}+\frac {2\,b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a}\right )}{a}\right )}{a}\right )}{a}\right )}{d}+\frac {{\cos \left (c+d\,x\right )}^3\,\left (\frac {1}{a^2}+\frac {b^2\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{3\,a^2}-\frac {2\,b\,\left (\frac {2\,b^3}{a^5}+\frac {2\,b\,\left (\frac {3}{a^2}-\frac {3\,b^2}{a^4}\right )}{a}\right )}{3\,a}\right )}{d}-\frac {b\,{\cos \left (c+d\,x\right )}^6}{3\,a^3\,d}-\frac {-a^6\,b^2+3\,a^4\,b^4-3\,a^2\,b^6+b^8}{a\,d\,\left (\cos \left (c+d\,x\right )\,a^9+b\,a^8\right )}+\frac {\ln \left (b+a\,\cos \left (c+d\,x\right )\right )\,\left (2\,a^6\,b-12\,a^4\,b^3+18\,a^2\,b^5-8\,b^7\right )}{a^9\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________